home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software 2000
/
Software 2000 Volume 1 (Disc 1 of 2).iso
/
utilities
/
u267.dms
/
u267.adf
/
INC9110B.LZH
/
include
/
assert.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-19
|
1KB
|
40 lines
/*
* Libraries and headers for PDC release 3.3 (C) 1989 Lionel Hummel.
* PDC Software Distribution (C) 1989 Lionel Hummel and Paul Petersen.
* PDC I/O Library (C) 1987 by J.A. Lydiatt.
*
* This code is freely redistributable upon the conditions that this
* notice remains intact and that modified versions of this file not
* be included as part of the PDC Software Distribution without the
* express consent of the copyright holders. No warrantee of any
* kind is provided with this code. For further information, contact:
*
* PDC Software Distribution Internet: BIX:
* P.O. Box 4006 or hummel@cs.uiuc.edu lhummel
* Urbana, IL 61801-8801 petersen@uicsrd.csrd.uiuc.edu
*/
/* assert.h
*
* Tests a given conditional and program aborts with a diagnostic message
* if false.
*/
/*
* 2.3.91 sjw; fix up report of actual assertion as string
* 19.4.91 sjw; make into expression, so can be used in eg 'if'.
*/
#ifndef __ASSERT_H__
#define __ASSERT_H__
#ifndef NDEBUG
int _assert_fail(const char *exp, const char *file, int line);
#define assert(x) ((void)((x)||_assert_fail(#x, __FILE__, __LINE__)))
#else
#define assert(x)
#endif
#endif /* __ASSERT_H__ */